<!-- Main content -->
<div class="wrapper">
	<!-- Table with checkboxes -->
	<div class="widget">
		<div class="tablePars">
			<form id="search_form" action="<?php echo BASE_URL;?>admin/index" method="get">
				<div class="dataTables_filter">
					<label><span>Search:</span> 
					<input type="text" name="keywords" value="<?php echo $keywords;?>" placeholder="用户名">
					</label>
					<select name="role_id" class="select">
						<option value="">选择权限</option>
						<?php foreach ($role_list as $role):?>
						<option value="<?php echo $role['role_id'];?>" <?php if ($role['role_id'] == $role_id):?>selected="selected"<?php endif;?>><?php echo $role['role_name'];?></option>
						<?php endforeach;?>
					</select>
					<input type="submit" value="搜索" class="buttonS bBlue">
				</div>
			</form>
			<?php if (!empty($is_search)):?>
			<a href="<?php echo BASE_URL;?>admin/index"><span class="icos-arrowleft tipS" title="返回" style="margin:20px 0 0 5px"></span></a>
			<?php endif;?>
		</div>
		<div class="clear"></div>
		
		<div class="whead">
			<h6>管理员列表</h6>
			<div class="clear"></div>
		</div>
		<table cellpadding="0" cellspacing="0" width="100%" class="tDefault">
			<thead>
				<tr>
					<td>用户名</td>
					<td>权限组</td>
					<td>状态</td>
					<td>添加时间</td>
					<td>操作</td>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="6">
						<div class="tPages">
						<?php if (!empty($pages)):?>
							<?php $this->widget('MCLinkPager', array('pages' => $pages));?>
						<?php endif;?>
						</div>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php if (!empty($res)):?>
			<?php foreach ($res as $item):?>
				<tr>
					<td class="tableActs"><?php echo CHtml::encode($item['admin_name']);?></td>
					<td class="tableActs"><a href="<?php echo BASE_URL;?>role/index/preViewRole/1/role_id/<?php echo $item['role_id'];?>" class="tipS preview_role" title="查看权限"><?php echo CHtml::encode($role_list[$item['role_id']]['role_name']);?></a></td>
					<td align="center">
					<?php if ($this->checkRights(Yii::app()->user->act_rights, 'admin', 'editstatus')):?>
						<input type="checkbox" <?php if ($item['status'] == 1):?>checked="checked"<?php endif;?> name="admin_id_<?php echo $item['admin_id'];?>" value="<?php echo $item['status'];?>" class="admin_status" />
					<?php else:?>
						<?php echo $status[$item['status']];?>
					<?php endif;?>
					</td>
					<td align="center"><?php echo date('Y-m-d H:i:s', $item['add_time']);?></td>
					<td class="tableActs">
					<?php if ($this->checkRights(Yii::app()->user->act_rights, 'admin', 'editpass')):?>
                    	<a href="<?php echo BASE_URL;?>admin/editpass/admin_id/<?php echo $item['admin_id'];?>" class="buttonSS bDefault tipS edit_admin" title="修改密码"><span class="icos-pencil"></span></a>
                    <?php endif;?>
                    <?php if ($this->checkRights(Yii::app()->user->act_rights, 'admin', 'editrole')):?>
                    	<a href="<?php echo BASE_URL;?>admin/editrole/admin_id/<?php echo $item['admin_id'];?>" class="buttonSS bDefault tipS edit_admin" title="编辑权限"><span class="icos-user2"></span></a>
                    <?php endif;?>
                    <?php if ($this->checkRights(Yii::app()->user->act_rights, 'admin', 'del')):?>
						<a href="<?php echo BASE_URL;?>admin/del/admin_id/<?php echo $item['admin_id'];?>" class="buttonSS bDefault tipS del" title="删除"><span class="icos-cross"></span></a>
					<?php endif;?>
						<!-- <a href="#" class="tablectrl_small bDefault" title="Options"><span class="icos-cog3 nomargin nopadding"></span></a> -->
					</td>
				</tr>
			<?php endforeach;?>
			<?php endif;?>
			</tbody>
		</table>

	</div>
</div>
<!-- Main content ends -->